package com.hitqz.robot.biz.flow.component.agv;

import cn.hutool.json.JSONObject;
import com.hitqz.robot.biz.flow.domain.constant.FlowConstant;
import com.yomahub.liteflow.annotation.LiteflowComponent;
import com.yomahub.liteflow.core.NodeComponent;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * @author xupkun
 * @date 2025/2/27
 */
@Slf4j
@LiteflowComponent(value = "ReadModuleStatus", name = "[轮对/轮轴]读取传感器模块数据")
@AllArgsConstructor
public class ReadModuleStatus extends NodeComponent {

    @Override
    public void process() throws Exception {
        String ipKey = FlowConstant.NODE_CUSTOM_INFO_MAP.get(this.getNodeId()).getParamNames().get(0);
        String ip = this.getCmpData(JSONObject.class).get(ipKey, String.class);
        String statusKey = FlowConstant.NODE_CUSTOM_INFO_MAP.get(this.getNodeId()).getParamNames().get(1);
        Integer status = this.getCmpData(JSONObject.class).get(statusKey, Integer.class);
        log.info("需要校验的传感器的ip{},status{}", ip, status);



    }
}
